FROM mysql:5

COPY mysqld.cnf /etc/mysql/mysql.conf.d/mysqld.cnf

RUN mkdir -p /mysqld/data && \
    chown mysql /mysqld && \
    chown mysql /mysqld/data && \
    /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo 'Asia/Shanghai' > /etc/timezone  && \
    chmod 644 /etc/mysql/mysql.conf.d/mysqld.cnf
